package com.sfzlot.dev.netty.bean.data;

import com.sfzlot.dev.netty.bean.inf.Data;
import com.sfzlot.dev.netty.utils.ByteUtil;

import java.util.Date;


/**
 * 设备登入信息返回体
 * Created by pierr on 2017/5/30.
 */
public class DeviceLoginOutData implements Data {
    
    private Date dataCollectTime;	// 数据采集时间
    private String bak;			// 预留

    public Date getDataCollectTime() {
        return dataCollectTime;
    }

    public void setDataCollectTime(Date dataCollectTime) {
        this.dataCollectTime = dataCollectTime;
    }

    
	public String getBak() {
		return bak;
	}

	public void setBak(String bak) {
		this.bak = bak;
	}


	@Override
	public String toString() {
		return "DeviceLoginOutData [dataCollectTime=" + dataCollectTime + ", bak=" + bak + "]";
	}

	@Override
	public byte[] toBytes(){
		byte[] dateBytes = ByteUtil.timeToBytes(dataCollectTime);
		byte[] bakBytes = ByteUtil.stringToByte(bak, 32);
		return ByteUtil.addAll(dateBytes, bakBytes);
	}

	@Override
	public String transData() {
		return "DeviceLoginInData(设备登入返回信息体) [dataCollectTime=" + dataCollectTime + ", bak=" + bak + "]";
	}
}
